import java.util.Scanner;

public class YangHuiTriangle {
    public static void main(String[] args){
            System.out.println("请输入整数");
            Scanner sc = new Scanner(System.in);
            int rowNum = sc.nextInt();
            int[][] arr = new int[rowNum][]; //初始化但是并没有内存申请
            for(int i = 0;i<rowNum;i++){
                arr[i] = new int[i+1];
                for(int j = 0;j<i+1;j++){
                        if(j==0) {
                            arr[i][0] = 1;
                        }else if(j == i){
                            arr[i][j] = 1;
                        }else{
                            arr[i][j] = arr[i-1][j-1] + arr[i-1][j];
                        }
                }
            }
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.println(arr[i][j]);
            }
            System.out.println(" ");
        }
    }
}
